from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, Text, Float
from applications.models import baseModel


# v2ray 用户列表
class V2rayUserList(baseModel):
    __tablename__ = "v2ery_users"
    id = Column(Integer, primary_key=True, comment='主键id')
    name = Column(String(255), comment='名字')
    user_id = Column(String(255), comment='用户id')
    port = Column(String(50), comment='协议端口号')
    url = Column(Text, comment='协议地址')
    limit_time = Column(String(100), comment='限制时间')
    limit_traffic = Column(Float, comment='限制流量')
    is_main = Column(Integer, comment='是否主用户', default=0)
    enable = Column(Integer, comment='是否开启', default=0)
    create_time = Column(DateTime, default=datetime.now, comment='创建时间')
    update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')